package com.inifitness.message.context;

import java.util.List;
import java.util.Map;

import com.inifitness.common.event.event.MessageEvent;
import com.inifitness.message.processor.message.MessageProcessor;
import com.inifitness.message.service.EventTemplate;
import com.inifitness.message.service.EventTemplateService;

import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * 奖励处理上下文
 *
 * @author sunjinfeng
 * @version 1.0.0
 * @since 2024-05-30 10:28
 */
@RequiredArgsConstructor
@Log4j2
@Component
public class AwardProcessorContext {

  private final Map<String, MessageProcessor> senderMap;
  private final EventTemplateService eventTemplateService;


  @Async
  @SuppressWarnings("unused")
  public void award(MessageEvent event) {
    // 获取事件绑定的所有模板:
    List<EventTemplate> templates = eventTemplateService.findByEventCode(event.eventCode());
  }
}
